﻿using System;
using Microsoft.Xna.Framework;

namespace Metropolitics.Source
{
    class Camera
    {
        #region Members

        private Vector2 position;
        private Vector2 dimensions;
        private Vector2 velocity;
        private Vector2 target;
        
        private float maxspeed;
        private float currtraveltime;
        private float actualtraveltime;
                                                                                                            
        #endregion

        #region Properties

        public Vector2 Position
        {
            get
            {
                return position;
            }
        }

        public Vector2 Dimensions
        {
            get
            {
                return dimensions;
            }
        }

        public Vector2 Velocity
        {
            get
            {
                return velocity;
            }
        }
      
        public float Left
        {
            get
            {
                return position.X - dimensions.X / 2;
            }
        }

        public float Right
        {
            get
            {
                return position.X + dimensions.X / 2;
            }
        }

        public float Top
        {
            get
            {
                return position.Y - dimensions.Y / 2;
            }
        }

        public float Bottom
        {
            get
            {
                return position.Y + dimensions.Y / 2;
            }
        }

        #endregion

        #region Functions

        public Camera(Vector2 _position, Vector2 _dimensions)
        {
            position = _position;
            dimensions = _dimensions;
            velocity = Vector2.Zero;
            target = Vector2.Zero;
            isready = true;
        }

        public void Follow(float _x, float _y)
        {
            target.X = _x;
            target.Y = _y;
        }

        public void MoveTo(float _x, float _y, float _time)
        {
            target.X = _x;
            target.Y = _y;

            Vector2 totarget;
            totarget.X = target.X - position.X;
            totarget.Y = target.Y - position.Y;

           

            isready = false;
        }

        public void Update()
        {
           
        }

        #endregion
    }
}
